var sBiosRef = <r><![CDATA[

; Function : Tests RAM and sets RAM slot for the system
; Registers: All
; Remark   : After this, a jump must be made to INIT, for further initialisation.
CHKRAM: EQU 0000h

; Function : tests whether the character of [HL] is the specified character
;            if not, it generates SYNTAX ERROR, otherwise it goes to CHRGTR (#0010)
; Input    : set the character to be tested in [HL] and the character to be
;            compared next to RST instruction which calls this routine (inline parameter)
; Output   : HL is increased by one and A receives [HL], When the tested character is
;            numerical, the CY flag is set the end of the statement (00h or 3Ah) causes
;            the Z flag to be set
; Registers: AF, HL
SYNCHR: EQU 0008h

; Function : Reads the value of an address in another slot
; Input    : A  - ExxxSSPP
;            |        || Primary  slotnumber  (00-11)
;            |        - Secundary slotnumber (00-11)
;            +----------- Expanded slot (0 = no, 1 = yes)
;            HL - Address to read
; Output   : A  - Contains the vaule of the read address
; Registers: AF, C, DE
; Remark   : This routine turns off the interupt, but won't turn it on again
RDSLT: EQU 000Ch

; Function : Gets the next character (or token) of the Basic-text
; Input    : HL - Address last character
; Output   : HL - points to the next character
;            A  - contains the character
;            C  - flag set if it's a number
;            Z  - flag set if it's the end of the statement
; Registers: AF, HL
CHRGTR: EQU 0010h

; Function : Writes a value to an address in another slot.
; Input    : A  - Slot in which the value will be written
;            see RDSLT for input
;            HL - Address of value to write
;            E  - value to write
; Registers: AF, BC, D
; Remark   : See RDSLT
WRSLT: EQU 0014h

; Function : Output to current outputchannel (printer, diskfile, etc.)
; Input    : A  - PRTFIL, PRTFLG
; Remark   : Used in basic, in ML it's pretty difficult
OUTDO: EQU 0018h

; Function : Executes inter-slot call.
; Input    : IY - High byte with input for A in RDSLT
;            IX - The address that will be called
; Remark   : Variables can never be given in alternative registers
;            of the Z-80 or IX and IY
CALSLT: EQU 001Ch

; Function : Compares HL with DE
; Input    : HL, DE
; Output   : Z-flag set if HL and DE are the same.
; Registers: AF
DCOMPR: EQU 0020h

; Function : Switches indicated slot at indicated page on perpetual
; Input    : A  - ExxxSSPP
;                 +-?------ see RDSLT
;            H - Bit 6 and 7 must contain the page number (00-11)
ENASLT: EQU 0024h

; Function : Returns Type of DAC
; Input    : DAC
; Output   : S,Z,P/V, CY
; Registers: AF
; Remark   : Not a very clear routine to me, please mail us if you know more about it.
GETYPR: EQU 0028h

; Function : Executes an interslot call
; Output   : depends on the calling routine
; Registers: AF, and the other registers depending on the calling routine
; Remark   : The following is the calling sequence:
;            RST #30
;            DB destination slot (see RDSLT accu)
;            DW destination address
CALLF: EQU 0030h

; Function : Executes the timer interrupt process routine
; Initialization-routines
KEYINT: EQU 0038h

; Function : Initialises the device
; Registers: All
INITIO: EQU 003Bh

; Function : Initialises the contents of the function keys
; Registers: All
; VDP routines
INIFNK: EQU 003Eh

; Function : inhibits the screen display
; Registers: AF, BC
DISSCR: EQU 0041h

; Function : displays the screen
; Registers: AF, BC
ENASCR: EQU 0044h

; Function : write data in the VDP-register
; Input    : B  - data to write
;            C  - number of the register
; Registers: AF, BC
WRTVDP: EQU 0047h

; Function : Reads the content of VRAM
; Input    : HL - address read
; Output   : A  - value which was read
; Registers: AF
RDVRM: EQU 004Ah

; Function : Writes data in VRAM
; Input    : HL - address write
;            A  - value write
; Registers: AF
WRTVRM: EQU 004Dh

; Function : Enable VDP to read
; Input    : HL - for VRAM-address
; Registers: AF
SETRD: EQU 0050h

; Function : Enable VDP to write
; Input    : HL - Address
; Registers: AF
SETWRT: EQU 0053h

; Function : fill VRAM with value
; Input    : A  - data byte
;            BC - length of the area to be written
;            HL - start address
; Registers: AF, BC
FILVRM: EQU 0056h

; Function : Block transfer to memory from VRAM
; Input    : BC - blocklength
;            DE - Start address of memory
;            HL - Start address of VRAM
; Registers: All
LDIRMV: EQU 0059h

; Function : Block transfer to VRAM from memory
; Input    : BC - blocklength
;            DE - Start address of VRAM
;            HL - Start address of memory
; Registers: All
LDIRVM: EQU 005Ch

; Function : Switches to given screenmode
; Input    : A  - screen mode
; Registers: All
CHGMOD: EQU 005Fh

; Function : Changes the screencolors
; Input    : Foregroundcolor in FORCLR
;            Backgroundcolor in BAKCLR
;            Bordercolor in BDRCLR
; Registers: All
CHGCLR: EQU 0062h

; Function : Executes (non-maskable interupt) handling routine
NMI: EQU 0066h

; Function : Initialises all sprites
; Input    : SCRMOD
; Registers: Alles
CLRSPR: EQU 0069h

; Function : Schakelt naar SCREEN 0 (tekst-scherm met 40*24 tekens)
; Input    : TXTNAM, TXTCGP
; Registers: All
INITXT: EQU 006Ch

; Function : Switches to SCREEN 1 (text screen with 32*24 characters)
; Input    : T32NAM, T32CGP, T32COL, T32ATR, T32PAT
; Registers: All
INIT32: EQU 006Fh

; Function : Switches to SCREEN 2 (high resolution screen with 256*192 pixels)
; Input    : GRPNAM, GRPCGP, GRPCOL, GRPATR, GRPPAT
; Registers: All
INIGRP: EQU 0072h

; Function : Switches to SCREEN 3 (multi-color screen 64*48 pixels)
; Input    : MLTNAM, MLTCGP, MLTCOL, MLTATR, MLTPAT
; Registers: All
INIMLT: EQU 0075h

; Function : Switches to VDP in SCREEN 0 mode
; Input    : See INITXT
; Registers: All
SETTXT: EQU 0078h

; Function : Schakelt VDP in SCREEN 1 modus
; Input    : See INIT32
; Registers: All
SETT32: EQU 007Bh

; Function : Switches VDP to SCREEN 2 mode
; Input    : See INIGRP
; Registers: All
SETGRP: EQU 007Eh

; Function : Switches VDP to SCREEN 3 mode
; Input    : See INIMLT
; Registers: All
SETMLT: EQU 0081h

; Function : Returns the address of the sprite pattern table
; Input    : A  - Sprite ID
; Output   : HL - For the address
; Registers: AF, DE, HL
CALPAT: EQU 0084h

; Function : Returns the address of the sprite attribute table
; Input    : A  - Sprite number
; Output   : HL - For the address
; Registers: AF, DE, HL
CALATR: EQU 0087h

; Function : Returns current sprite size
; Output   : A  - Sprite-size in bytes
;            C-flag set when size is 16*16 sprites otherwise C-flag is reset
; Registers: AF
GSPSIZ: EQU 008Ah

; Function : Displays a character on the graphic screen
; Input    : A  - ASCII value of the character to print
; PSG routines
GRPPRT: EQU 008Dh

; Function : Initialises PSG and sets initial value for the PLAY statement
; Registers: All
GICINI: EQU 0090h

; Function : Writes data to PSG-register
; Input    : A  - PSG register number
;            E  - data write
WRTPSG: EQU 0093h

; Function : Reads value from PSG-register
; Input    : A  - PSG-register read
; Output   : A  - value read
RDPSG: EQU 0096h

; Function : Tests whether the PLAY statement is being executed as a background
;            task. If not, begins to execute the PLAY statement
; Registers: All
; Console routines
STRTMS: EQU 0099h

; Function : Tests the status of the keyboard buffer
; Output   : Z-flag set if buffer is filled
; Registers: AF
CHSNS: EQU 009Ch

; Function : One character input (waiting)
; Output   : A  - ASCII-code of the input character
; Registers: AF
CHGET: EQU 009Fh

; Function : Displays one character
; Input    : A  - ASCII-code of character to display
CHPUT: EQU 00A2h

; Function : Sends one character to printer
; Input    : A  - ASCII-code of character to send
; Output   : C-flag set if failed
; Registers: F
LPTOUT: EQU 00A5h

; Function : Tests printer status
; Output   : A  - #FF and Z-flag reset if printer is ready
;                 #00 and Z-flag set if not ready
; Registers: AF
LPTSTT: EQU 00A8h

; Function : tests for the graphic header and transforms the code
; Input    : A  - charactercode
; Output   : the C-flag is reset to not the graphic reader
;            the C-flag and Z-flag are set to the transformed code is set in A
;            the C-flag is set and Z-flag is reset to the untransformed code is set in A
; Registers: AF
CNVCHR: EQU 00ABh

; Function : Stores in the specified buffer the character codes input until the return
;            key or STOP key is pressed
; Output   : HL - for the starting address of the buffer -1
;            C-flag set when it ends with the STOP key
; Registers: All
PINLIN: EQU 00AEh

; Function : Same as PINLIN except that AUGFLG (#F6AA) is set
; Output   : HL - for the starting address of the buffer -1
;            C-flag set when it ends with the STOP key
; Registers: All
INLIN: EQU 00B1h

; Function : Prints a questionmark andone space
; Output   : HL - for the starting address of the buffer -1
;            C-flag set when it ends with the STOP key
; Registers: All
QINLIN: EQU 00B4h

; Function : Tests status of CTRL-STOP
; Output   : C-flag set when pressed
; Registers: AF
; Remark   : In this routine, interrupts are inhibited
BREAKX: EQU 00B7h

; Function : Tests status of SHIFT-STOP
ISCNTC: EQU 00BAh

; Function : Same as ISCNTC. used in Basic
CKCNTC: EQU 00BDh

; Function : generates beep
; Registers: All
BEEP: EQU 00C0h

; Function : Clears the screen
; Registers: AF, BC, DE
; Remark   : Z-flag must be set to be able to run this routine
;            XOR A will do fine most of the time
CLS: EQU 00C3h

; Function : Plaatst cursor op aangegeven positie
; Input    : H  - Y coordinate of cursor
;            L  - X coordinate of cursor
; Registers: AF
POSIT: EQU 00C6h

; Function : Tests whether the function key display is active (FNKFLG)
;            If so, displays them, otherwise erase them
; Input    : FNKFLG (#FBCE)
; Registers: All
FNKSB: EQU 00C9h

; Function : Erase functionkey display
; Registers: All
ERAFNK: EQU 00CCh

; Function : Displays the function keys
; Registers: All
DSPFNK: EQU 00CFh

; Function : Forces the screen to be in the text mode
; Registers: All
; Controller routines
TOTEXT: EQU 00D2h

; Function : Returns the joystick status
; Input    : A  - Joystick number to test (0 = cursors, 1 = port 1, 2 = port 2)
; Output   : A  - Direction
; Registers: All
GTSTCK: EQU 00D5h

; Function : Returns current trigger status
; Input    : A  - trigger button to test
;            0 = spacebar
;            1 = port 1, button A
;            2 = port 2, button A
;            3 = port 1, button B
;            4 = port 2, button B
; Output   : A  - #00 trigger button not pressed
;                 #FF trigger button pressed
; Registers: AF
GTTRIG: EQU 00D8h

; Function : Returns current touch pad status
; Input    : A  - Touchpad number to test
; Output   : A  - Value
; Registers: All
GTPAD: EQU 00DBh

; Function : Returns currenct value of paddle
; Input    : A  - Paddle number
; Output   : A  - Value
; Registers: All
; Tape device routines
GTPDL: EQU 00DEh

; Function : Reads the header block after turning the cassette motor on
; Output   : C-flag set if failed
; Registers: All
TAPION: EQU 00E1h

; Function : Read data from the tape
; Output   : A  - read value
;            C-flag set if failed
; Registers: All
TAPIN: EQU 00E4h

; Function : Stops reading from the tape
TAPIOF: EQU 00E7h

; Function : Turns on the cassette motor and writes the header
; Input    : A  - #00 short header
;             not #00 long header
; Output   : C-flag set if failed
; Registers: All
TAPOON: EQU 00EAh

; Function : Writes data on the tape
; Input    : A  - data to write
; Output   : C-flag set if failed
; Registers: All
TAPOUT: EQU 00EDh

; Function : Stops writing on the tape
TAPOOF: EQU 00F0h

; Function : Sets the cassette motor action
; Input    : A  - #00 stop motor
;                 #01 start motor
;                 #FF reverse the current action
; Registers: AF
; Queue routines
STMOTR: EQU 00F3h

; Function : Gives number of bytes in queue
; Output   : A  - length of queue in bytes
; Remark   : Internal use
LFTQ: EQU 00F6h

; Function : Put byte in queue
; Remark   : Internal use
; Graphic routines
PUTQ: EQU 00F9h

; Function : Shifts screenpixel to the right
; Registers: AF
RIGHTC: EQU 00FCh

; Function : Shifts screenpixel to the left
; Registers: AF
LEFTC: EQU 00FFh

; Function : Shifts screenpixel up
; Registers: AF
UPC: EQU 0102h

; Function : Tests whether UPC is possible, if possible, execute UPC
; Output   : C-flag set if operation would end outside the screen
; Registers: AF
TUPC: EQU 0105h

; Function : Shifts screenpixel down
; Registers: AF
DOWNC: EQU 0108h

; Function : Tests whether DOWNC is possible, if possible, execute DOWNC
; Output   : C-flag set if operation would end outside the screen
; Registers: AF
TDOWNC: EQU 010Bh

; Function : Scales X and Y coordinates
SCALXY: EQU 010Eh

; Function : Places cursor at current cursor address
MAPXY: EQU 0111h

; Function : Gets current cursor addresses mask pattern
; Output   : HL - Cursor address
;            A  - Mask pattern
FETCHC: EQU 0114h

; Function : Record current cursor addresses mask pattern
; Input    : HL - Cursor address
;            A  - Mask pattern
STOREC: EQU 0117h

; Function : Set attribute byte
SETATR: EQU 011Ah

; Function : Reads attribute byte of current screenpixel
READC: EQU 011Dh

; Function : Returns currenct screenpixel of specificed attribute byte
SETC: EQU 0120h

; Function : Set horizontal screenpixels
NSETCX: EQU 0123h

; Function : Gets screen relations
; Output   : DE, HL
; Registers: DE, HL
GTASPC: EQU 0126h

; Function : Initalises the PAINT instruction
PNTINI: EQU 0129h

; Function : Scans screenpixels to the right
SCANR: EQU 012Ch

; Function : Scans screenpixels to the left
; Misc routines
SCANL: EQU 012Fh

; Function : Alternates the CAP lamp status
; Input    : A  - #00 is lamp on
;             not #00 is lamp off
; Registers: AF
CHGCAP: EQU 0132h

; Function : Alternates the 1-bit sound port status
; Input    : A  - #00 to turn off
;             not #00 to turn on
; Registers: AF
CHGSND: EQU 0135h

; Function : Reads the primary slot register
; Output   : A  - for the value which was read
;            33221100
;            ||||||- Pagina 0 (#0000-#3FFF)
;            ||||--- Pagina 1 (#4000-#7FFF)
;            ||----- Pagina 2 (#8000-#BFFF)
;            ------- Pagina 3 (#C000-#FFFF)
; Registers: A
RSLREG: EQU 0138h

; Function : Writes value to the primary slot register
; Input    : A  - value value to (see RSLREG)
WSLREG: EQU 013Bh

; Function : Reads VDP status register
; Output   : A  - Value which was read
; Registers: A
RDVDP: EQU 013Eh

; Function : Returns the value of the specified line from the keyboard matrix
; Input    : A  - for the specified line
; Output   : A  - for data (the bit corresponding to the pressed key will be 0)
; Registers: AF
SNSMAT: EQU 0141h

; Function : Executes I/O for mass-storage media like diskettes
; Input    : B  - Number of sectors
;            C  - Media ID of the disk
;            DE - Begin sector
;            HL - Begin address in memory
; Registers: All
; Remark   : Before the call is called, the Z-flag must be reset, and the execution
;            address which was in HL must be at the last stack address
;            By the way: In minimum configuration only a HOOK is available
PHYDIO: EQU 0144h

; Function : Initialises mass-storage media like formatting of diskettes
; Registers: All
; Remark   : In minimum configuration only a HOOK is available
FORMAT: EQU 0147h

; Function : Tests if I/O to device is taking place
; Output   : A  - #00 if not taking place
;             not #00 if taking place
; Registers: AF
ISFLIO: EQU 014Ah

; Function : Printer output
; Input    : A  - code to print
; Registers: F
; Remark   : Differences with LPTOUT:
;            1. TAB is expanded to spaces
;            2. For non-MSX printers, Hiragana is transformed to katakana
;               and graphic characters are transformed to 1-byte characters
;            3. If failed, device I/O error occurs
OUTDLP: EQU 014Dh

; Function : Returns pointer to play queue
; Input    : A  - Channel number
; Output   : HL - Pointer
; Registers: AF
; Remark   : Only used to play music in background
GETVCP: EQU 0150h

; Function : Returns pointer to variable in queue number VOICEN (byte op #FB38)
; Input    : L  - Pointer in play buffer
; Output   : HL - Pointer
; Registers: AF
GETVC2: EQU 0153h

; Function : Clear keyboard buffer
; Registers: HL
KILBUF: EQU 0156h

; Function : Executes inter-slot call to the routine in BASIC interpreter
; Input    : IX - for the calling address
; Output   : Depends on the called routine
; Registers: Depends on the called routine
; MSX 2 BIOS Entries
CALBAS: EQU 0159h

; Function : Calls a routine in SUB-ROM
; Input    : IX - Address of routine in SUB-ROM
; Output   : Depends on the routine
; Registers: Alternative registers, IY
; Remark   : Use of EXTROM or CALSLT is more convenient.
;            In IX a extra value to the routine can be given by first
;            PUSH'ing it to the stack.
SUBROM: EQU 015Ch

; Function : Calls a routine in SUB-ROM. Most common way
; Input    : IX - Address of routine in SUB-ROM
; Output   : Depends on the routine
; Registers: Alternative registers, IY
; Remark   : Use: LD IX,address
;                 CALL EXTROM
EXTROM: EQU 015Fh

; Function : Search slots for SUB-ROM
; Registers: Alles
CHKSLZ: EQU 0162h

; Function : Tests screen mode
; Output   : C-flag set if screenmode = 5, 6, 7 or 8
; Registers: AF
CHKNEW: EQU 0165h

; Function : Deletes to the end of the line
; Input    : H  - x-coordinate of cursor
;            L  - y-coordinate of cursor
; Registers: All
EOL: EQU 0168h

; Function : Same function as FILVRM (total VRAM can be reached).
; Input    : HL - address
;            BC - length
;            A  - data
; Registers: AF,BC
BIGFIL: EQU 016Bh

; Function : Same function as SETRD.(with full 16 bits VRAM-address)
; Input    : HL - VRAM address
; Registers: AF
NSETRD: EQU 016Eh

; Function : Same function as SETWRT.(with full 16 bits VRAM-address)
; Input    : HL - VRAM address
; Registers: AF
NSTWRT: EQU 0171h

; Function : Reads VRAM like in RDVRM.(with full 16 bits VRAM-address)
; Input    : HL - VRAM address
; Output   : A  - Read value
; Registers: F
NRDVRM: EQU 0174h

; Function : Writes to VRAM like in WRTVRM.(with full 16 bits VRAM-address)
; Input    : HL - VRAM address
;            A  - Value to write
; Registers: AF
; MSX 2+ BIOS Entries
NWRVRM: EQU 0177h

; Function : Read value of I/O poort #F4
; Input    : none
; Output   : A = value read
; Registers: AF
RDBTST: EQU 017Ah

; Function : Write value to I/O poort #F4
; Input    : A = value to write
;            Bit 7 shows the MSX 2+ startup screen when reset, otherwise it's skipped.
; Output   : none
; Registers: none
; MSX turbo R BIOS Entries
WRBTST: EQU 017Dh

; Function : Changes CPU mode
; Input    : A = LED 0 0 0 0 0 x x
;                 |            0 0 = Z80 (ROM) mode
;                 |            0 1 = R800 ROM  mode
;                 |            1 0 = R800 DRAM mode
;                LED indicates whether the Turbo LED is switched with the CPU
; Output   : none
; Registers: none
CHGCPU: EQU 0180h

; Function : Returns current CPU mode
; Input    : none
; Output   : A = 0 0 0 0 0 0 x x
;                            0 0 = Z80 (ROM) mode
;                            0 1 = R800 ROM  mode
;                            1 0 = R800 DRAM mode
; Registers: AF
GETCPU: EQU 0183h

; Function : Plays specified memory area through the PCM chip
; Input    : A = v 0 0 0 0 0 x x
;                |           | |
;                |           +-+-- Quality parameter (Speed: 0 = Fast)
;                +---------------- VRAM usage flag
;            HL= Start address in RAM or VRAM
;            BC= Length of area to play
;            D = Bit 0 = Bit 17 of area length when using VRAM
;            E = Bit 0 = Bit 17 os start address when using VRAM
; Output   : C-flag set when aborted with CTRL-STOP
; Registers: all
PCMPLY: EQU 0186h

]]></r>;
